When ice or any other solid melts, its potential energy increases. Indeed, this is the only increase in energy, since the thermal kinetic energy, or temperature, does not increase while melting. Potential energy is the latent energy that could be released by the water, and this increases because the water will release heat energy if it is frozen solid again.
Ice is the lowest energy state of water at normal Earth pressures. At each phase change of water, whether ice to liquid water or liquid water to water vapor, the potential energy decreases. This is due to the Law of Conservation of Energy. Materials undergoing a change of state absorb or release heat energy, but their temperatures do not change. This is because, while the state change is occurring, all the heat energy is converted into the potential energy of the new state of matter.
Water, in particular, has a very large change in potential energy during phase changes. It takes a great deal of energy to change water from one state to another. This is because of the strong hydrogen bonds that form between water molecules. The liquid phase allows water molecules to be in contact with each other, while the solid phase puts water molecules in an overall optimal configuration relative to each other.