Catalyzes the formation of 6,7-dimethyl-8-ribityllumazine by condensation of 5-amino-6-(D-ribitylamino)uracil with 3,4-dihydroxy-2-butanone 4-phosphate. This is the penultimate step in the biosynthesis of riboflavin