Analytical conditions for strange chaotic and nonchaotic attractors of the quasiperiodically forced van der Pol equation