Glass transition and layering effects in confined water: A computer simulation study