Whales 'led astray by magnetism'