Influence of laser beam profile on the generation of ultrasonic waves