Tilted photoalignment of a nematic liquid crystal induced by a magnetic field