Variational quantum eigensolver with fewer qubits