This paper studies the combined problem of base station location and optimal power allocation, in order to optimize the energy efficiency of a cellular wireless network. Recent work has suggested that moving from a network of a small number of high power macrocells to a larger number of smaller microcells may improve the energy efficiency of the network. This paper investigates techniques to optimize the number of base stations and their locations, in order to minimize energy consumption. An important contribution of the paper is that it takes into account non-uniform user distributions across the coverage area, which is likely to be encountered in practice. The problem is solved using approaches from optimization theory that deal with the facility location problem. Stochastic programming techniques are used to deal with the expected user distributions. An example scenario is presented to illustrate how the technique works and the potential performance gains that can be achieved.