Dynamics of polymer chains in confined space. A computer simulation study