This is something of a trick question, for a number of different reasons. If a single ice cube is floating in the water, part of it will inevitably protrude above the surface and thereby be exposed to the air, not water, so that in most comparative settings the ice is melting in both air and water, at the same time.
Secondly, a lot depends on the respective temperatures of the air and water. If an ice cube is floating in hot water and is then placed in winter or cold air conditions, the discrepancy between the two melting processes will be even more noticeable. There is also the issue of salt water vs. fresh water.
Properties of Water vs. Atmospheric Properties of Air
But assuming that an ice cube is floating in a glass of water at room temperature, the portion of the ice cube in the water will melt faster than the portion exposed to air, because the enveloping properties of water are able to more efficiently transfer heat onto the ice cube than the atmospheric properties of air. There are a myriad of elementary school science experiment syllabuses involving this type of experiment and other ice cube based projects, because ice is a plentiful, cheap, and safe material for young children to handle. At a certain temperature differential threshold, the ice cube will melt faster in the (hot) air than the (cold) water.
Nevertheless, the fundamental principles at work when an ice cube melts are not as simple as they may seem. Scientists at the University of Pennsylvania enlarged the atoms involved in the process of ice melting so that they could monitor the process through an optical microscope. They discovered that a pre-melting reaction occurs in the portions of the ice where atoms are not perfectly aligned, and that it is that pre-melting, or “cracking” that is ultimately the driver for the whole solid-to-liquid process. The imperfections observed in the enlarged ice samples to water as are the various grains to a piece of wood.