Dispersion theory and the low-energy constants for neutral-pion photoproduction