Dark matter in elliptical galaxies — II. Estimating the mass within the virial radius