Magnetic phases of the Hubbard model