Water loss is a phenomenon frequently observed within water distribution systems (WDSs), that is considerably worsened by an excessive pressure throughout the network. As an alternative option to pipe replacement, the use of pumps working as turbines, throttle control valves (TCVs), or pressure reduction valves (PRVs) can be used to reduce leakage. For a preassigned number of these devices, their positions and settings can be chosen to minimize the water losses in the network or to minimise the costs associated with the leakage. On the other hand, for a preassigned reduction in leakage, the number, the position and the setting of valves could be optimized in order to minimize their installation and maintenance costs. Based on these observations, a procedure for the optimal choice of the number, position and setting of PRVs is devised. The procedure is aimed at reducing the whole cost associated with water loss in urban WDSs, due to the background leakage from joints, and the purchase, installation and maintaining of the PRVs themselves. The effectiveness of the procedure, which is based on the physical modelling of leakage from pipe joints as well as on the use of a genetic algorithm, is proven using a small but realistic example.