Electrostatic contributions to solvation energies: comparison of free energy perturbation and continuum calculations