Answer: It is true that, at first glance, there seems to be a contradiction. For example, the UL for magnesium (above which the risk of adverse effects increases) is 350 mg per day for adults and children over age 8, but the RDA (the amount one needs) can be as high as 420 mg for many people within this group depending on gender and stage of life. However, the magnesium one consumes from food does not count toward the UL; only magnesium from supplements and medicine can cause adverse effects and counts toward this limit. So, as long as you're not getting more than 350 mg of magnesium per day from supplements and/or medicine and are getting some magnesium from foods (like whole grains, nuts, beans, and green leafy vegetables) you can satisfy the RDA without exceeding the UL.
The ULs established for niacin and folate also only apply to the amounts consumed from supplements and fortified foods and not from foods naturally containing these vitamins. For vitamin E, the upper limit is higher for the natural form than the synthetic form.