In massive MIMO systems, both energy efficiency (EE) and spectral efficiency (SE) have been recognized as important metrics for future communication system design. This paper investigates joint optimization of spatial and power resources to maximize the EE with guaranteed data rate requirement in downlink multiuser systems. Benefiting from the orthogonality of multiple propagation channels, the optimal number of antennas and radiated power are derived with closed forms. Analysis and simulation results demonstrate that when the circuit power consumed by each antenna decreases, configuring more antennas and radiating less power is more helpful to save energy. The SE points corresponding to the maximum EE decreases with the circuit power.