Study of Quantum Confinement of {\text{H}}_{2}^{ + } Ion and H2 Molecule with Monte Carlo. Respective Role of the Electron and Nuclei Confinement