We study structural, dynamical, and electronic properties of liquid water through ab initio molecular dynamics (MD) simulations based on a hybrid functional which includes nonlocal van der Waals (vdW) interactions. The water dimer, the water hexamer, and two phases of ice are studied as benchmark cases. The hydrogen-bond energy depends on the balance between Fock exchange and vdW interactions. Moreover, the energetic competition between extended and compact structural motifs is found to be well described by theory provided vdW interactions are accounted for. Applied to the hydrogen-bond network of liquid water, the dispersion interactions favor more compact structural motifs, bring the density closer to the experimental value, and improve the agreement with experimental observables such as radial distribution functions. The description of the self-diffusion coefficient is also found to improve upon the combined consideration of Fock exchange and vdW interactions. The band gap and the band edges are found to agree with experiment within 0.1 eV.