Critical role of water in the formation of continental crust