Sobolev spaces of maps and the Dirichlet problem for harmonic maps