Influence of the ac Stark effect on multiphoton transitions in molecules