Microscopic calculation of the pinning energy of a vortex in the inner crust of a neutron star