MAGIC discovery and multiwavelength observations of the BL Lac 1ES 1727+502