Completely disregarding magnetic fields for now, an extremely dense object like a magnetar (which is a kind of pulsar, which itself is a kind of neutron star) could destroy planets just with gravity (see Roche Limit). Now, if the planet is far away from the star, things might not be necessarily that ominous. The problem with electromagnetic forces is that their range is not as far-reaching as gravity. In fact, the first exoplanets ever detected were found around a pulsar (PSR B1257+12), and these objects already have pretty damn strong magnetic fields.
Here's the thing: atoms nuclei are held up by outrageously strong nuclear forces, but they are even more short-ranged than electromagnetic forces. I haven't run any numbers on this, but I think that these forces are so strong, that in order to break apart the atoms of the rocky planet just by using the magnetic fields, the planet would have to be so close to the magnetar, that its gravity would already have destroyed the planet.
However, the way gravity and electromagnetism precisely work on such extraordinary environments like the regions around a magnetar are still mysteries to be solved. Magnetism is counter-intuitive and the calculations are hard (been there). Even so, I think gravity would still win.