Nope, no contradiction. The law is about energy conversionconservation:
$$\Delta E_{system}=E_{in}-E_{out} \Rightarrow \\ \Delta U = Q-W$$
There is no work $W$ done if we assume constant volume. Internal energy $U$ is changing as you mention. But to vaporize or melt something, even though the temperature is constant you must apply heat $Q$. So $Q$ is also not constant, and: $\Delta U =Q$.
If the material will expand during melting/vaporizing, then there will be work and $W$ is not zero:
$$\Delta U=Q-W$$
Then even more heat $Q$ has to be added since some is used as work for the volume change. But the law of conservation of energy is still true.
Energy input must equal energy output. If it doesn't then the energy of the system must change, since the total sum must be zero (no energy disappears or shows up out of nothing). Your input is heat $Q$. SinceThe outgoing energy would be the work, if there is noany. Since the input of heat is larger than the outgoing energy (or else the material would not melt), the internal energy rises.
This rise could result in a temperature increase. But since your system is at a point where temperature cannot continue rising without a phase change, the energy must first be used for this phase change. After that, the temperature will continue to rise if you continue heating it up.