Optimal control in limit order books