The Cosmic-ray Electron Spectrum Measured with the MAGIC Telescopes