Coexistence of superconductivity and charge-density wave in the quasi-one-dimensional material HfTe3