Molecular dynamics study of the glass transition in confined water