Resonant Cyclotron Scattering in Three Dimensions and the Quiescent Nonthermal X-ray Emission of Magnetars