According to the World Health Organization, tuberculosis (TB) is the leading cause of death from infectious disease worldwide. While there is no effective vaccine against adult pulmonary TB, more than a dozen vaccine candidates are in the clinical trial pipeline. These include both pre-exposure vaccines to prevent initial infections and post-exposure vaccines to prevent reactivation of latent disease. Many epidemiological models have been used to study TB, but most have not included a continuous age structure and the possibility of both pre- and post-exposure vaccination. Incorporating age-dependent death rates, disease properties, and social contact data allows for more realistic modeling of disease spread. Here, we propose a continuous age-structured model for the epidemiology of tuberculosis with pre- and post-exposure vaccination. We use uncertainty and sensitivity analysis to make predictions about the efficacy of different vaccination strategies in a non-endemic setting (United States) and an endemic setting (Cambodia). In particular, we determine optimal age groups to target for pre-exposure and post-exposure vaccination in both settings. We find that the optimal age groups tend to be younger for Cambodia than for the US, and that post-exposure vaccination has a significantly larger effect than pre-exposure vaccination in the US.