We consider an optimal control problem for a single-spot pulsed laser welding problem. The distribution of thermal energy is described by a quasilinear heat equation. Our emphasis is on materials which tend to suffer from hot cracking when welded, such as aluminum alloys. A simple precursor for the occurrence of hot cracks is the velocity of the solidification front. We therefore formulate an optimal control problem whose objective contains a term which penalizes excessive solidification velocities. The control function to be optimized is the laser power over time, subject to pointwise lower and upper bounds. We describe the finite element discretization of the problem and a projected gradient scheme for its solution. Numerical experiments for material data representing the EN AW 6082-T6 aluminum alloy exhibit interesting laser pulse patterns which perform significantly better than standard ramp-down patterns.