We propose and analyze an optimal control problem where the control system is a mathematical model for tuberculosis that considers reinfection. The control functions represent the fraction of early latent and persistent latent individuals that are treated. Our aim was to study how these control measures should be implemented, for a certain time period, in order to reduce the number of active infected individuals, while minimizing the interventions implementation costs. The optimal intervention is compared along different epidemiological scenarios, by varying the transmission coefficient. The impact of variation of the risk of reinfection, as a result of acquired immunity to a previous infection for treated individuals on the optimal controls and associated solutions, is analyzed. A cost-effectiveness analysis is done, to compare the application of each one of the control measures, separately or in combination.