Euclid preparation: XI. Mean redshift determination from galaxy redshift probabilities for cosmic shear tomography