RNA is highly sensitive to the ionic environment, and typically requires Mg2+ to form compact structures. There is a need for models capable of describing the ion atmosphere surrounding RNA with quantitative accuracy. We present a model of RNA electrostatics and apply it within coarse-grained molecular dynamics simulation. The model treats Mg2+ ions explicitly to account for ion-ion correlations neglected by mean field theories. Since mean-field theories capture KCl well, it is treated implicitly by a generalized Manning counterion condensation model. The model extends Manning condensation to deal with arbitrary RNA conformations, non-limiting KCl concentrations, and the ion inaccessible volume of RNA. The model is tested against experimental measurements of the excess Mg2+ associated with the RNA, Γ2+, because Γ2+ is directly related to the Mg2+-RNA interaction free energy. The excellent agreement with experiment demonstrates the model captures the ionic dependence of the RNA free energy landscape.