Baryon resonances in nuclei: magnetic moments of the deuteron