The energy spectrum of ultra-high energy cosmic rays measured at the Pierre Auger Observatory and the Telescope Array