We deal with the optimal control problem governed by a hyperbolic variational inequality describing the perpendicular vibrations of a beam clamped on the left end with a rigid obstacle at the right end. A variable thickness of a beam plays the role of a control parameter.