Solution of the Riemann problem for van der Waals gas