The effect of confinement on the isotropic-nematic transition