Ultraviolet emission from magnesium atoms isolated in rare gas matrices