Young stellar populations in type II quasars: timing the onset of star formation and nuclear activity