The Helmholtz–Weyl decomposition in weighted Sobolev spaces