Ultra-high energy cosmic rays, spiral galaxies and magnetars