Measurement of the cosmic-ray energy spectrum above 2.5×1018 eV using the Pierre Auger Observatory