Morphological and spectral properties of the W51 region measured with the MAGIC telescopes