A bi-level modeling for traffic lights optimization is presented in the paper. The bi-level modeling allows increasing the set of control influences, the number of constraints and applies two goal functions in hierarchical order. The bi-level formalism allows integration of small optimization problems in hierarchical order to a complex interconnected and complicated optimization problem. These features have been applied for optimal control of traffic lights in urban network. The bilevel problem formulation allows to minimize the queue lengths of vehicles and to maximize the outgoing flows from arterial directions. Both control influences of the green light durations and time cycles are evaluated as optimal bi-level control influences.