Ab initio calculation of energy levels for phosphorus donors in silicon