A fast radio burst associated with a Galactic magnetar