There are two ways that water ice can form in the interstellar medium: H(2)O molecules can form in the gas phase and then freeze out onto dust grain surfaces, or O and OH can be converted at the surfaces of grains to form H(2)O, which is then retained. Bergin et al. (1998) have recently shown that shocks passing through interstellar clouds sufficiently frequently can make the first method effective. However, we present results from a similar chemical model which indicate that this requires significant optical shielding because of the high ionization fraction in regions exposed to a high UV flux. We deduce, therefore, that grain surface reactions probably represent the main source of H(2)O ice on lines of sight with visual extinction up to about 6 magnitudes to an embedded source or 12 magnitudes to a background object.