Nonlinear dynamics and chaos in an optomechanical beam