Electron-optical phase shift of magnetic nanoparticles I. Basic concepts