On the parallel-perpendicular transition for a nematic phase at a wall