Chaotic attitude motion of a magnetic rigid spacecraft