Vortex nucleation in type II superconductors