Equilibrium configuration of a nematic liquid crystal confined to a cylindrical cavity