Optimal control problem for the {L}yapunov exponents of random matrix products