Solving the Hubbard model using the variational quantum eigensolver