Catalyzes an early step in riboflavin biosynthesis, the NADPH-dependent reduction of the ribose side chain of 2,5-diamino-6-ribosylamino-4(3H)-pyrimidinone 5'-phosphate, yielding 2,5-diamino-6-ribitylamino-4(3H)-pyrimidinone 5'-phosphate