Catalyzes the conversion of quinonoid dihydrobiopterin into tetrahydrobiopterin. 5,6,7,8-tetrahydropteridine + NAD(+) = 6,7-dihydropteridine + H(+) + NADH 5,6,7,8-tetrahydropteridine + NADP(+) = 6,7-dihydropteridine + H(+) + NADPH kcat is 156 s(-1) for NADH. Homodimer. Belongs to the short-chain dehydrogenases/reductases (SDR) family.