Next generation (5G) cellular networks are expected to be supported by an extensive infrastructure with many-fold increase in the number of cells per unit area compared to today. The total energy consumption of base transceiver stations (BTSs) is an important issue for both economic and environmental reasons. In this paper, an optimization-based framework is proposed for energy-efficient global radio resource management in heterogeneous wireless networks. Specifically, with stochastic arrivals of known rates intended for users, the smallest set of BTSs is activated with jointly optimized user association and spectrum allocation to stabilize the network first and then minimize the delay. The scheme can be carried out periodically on a relatively slow timescale to adapt to aggregate traffic variations and average channel conditions. Numerical results show that the proposed scheme significantly reduces the energy consumption and increases the quality of service compared to existing schemes in the literature.