Coulomb energy of diffuse nuclear charge distributions