Resonant interaction of smooth laser pulses with two-level atoms