Including van der Waals interactions in first-principles electronic structure calculations