Orientational order and dynamics of a nematic liquid crystal in porous media