The efficacy of vaccination, incomplete treatment and disease relapse are critical challenges that must be faced to prevent and control the spread of infectious diseases. Age heterogeneity is also a crucial factor for this study. In this paper, we investigate a new age-structured SVEIR epidemic model with the nonlinear incidence rate, waning immunity, incomplete treatment and relapse. Next, the asymptotic smoothness, the uniform persistence and the existence of interior global attractor of the solution semi-flow generated by the system are given. We define the basic reproduction number and prove the existence of the equilibria of the model. And we study the global asymptotic stability of the equilibria. Then the parameters of the model are estimated using tuberculosis data in China. The sensitivity analysis of is derived by the Partial Rank Correlation Coefficient method. These main theoretical results are applied to analyze and predict the trend of tuberculosis prevalence in China. Finally, the optimal control problem of the model is discussed. We choose to take strengthening treatment and controlling relapse as the control parameters. The necessary condition for optimal control is established.