Magnetic Shielding of Nuclei in Molecules by a Variational Method