The shielding of the nuclear magnetic moment by the bound electron in hydrogenlike ions is calculated ab initio with inclusion of relativistic, nuclear, and quantum electrodynamics (QED) effects. The QED correction is evaluated to all orders in the nuclear binding strength parameter and, independently, to the first order in the expansion in this parameter. The results obtained lay the basis for the high-precision determination of nuclear magnetic dipole moments from measurements of the g factor of hydrogenlike ions.