Water in low-mass star-forming regions with Herschel. The link between water gas and ice in protostellar envelopes