In this paper, we address the problem of optimal synthesis of an integrated water system, where water using processes and water treatment operations are combined into a single network such that the total cost of obtaining freshwater for use in the water using operations, and treating wastewater is minimized. A superstructure, which incorporates all feasible design alternatives for water treatment, reuse and recycle, is proposed. We formulate this structure as a non-convex Non-Linear Programming (NLP) problem, which is solved to global optimality. The problem takes the form of a non-convex Generalized Disjunctive Program (GDP) if there is a flexibility of choosing different treatment technologies for the removal of the various contaminants in the wastewater streams. A new deterministic spatial branch and contract algorithm is proposed for optimizing such systems, in which piecewise under-and over-estimators are used to approximate the non-convex terms in the original model to obtain a convex relaxation whose solution gives a lower bound on the global optimum. These lower bounds are made to converge to the solution within a branch and bound procedure. Several examples are presented to illustrate the optimization of these integrated networks using the proposed algorithm.