Well according to Stephenie Meyer, Edward can produce sperm because he is a guy. Men can produce sperm from puberty to death. When one is transformed into a vampire they are frozen in that state forever. The same goes for female vampires and explains why they can't have children. The female body changes every month because of the menstrual cycle and after a while women experience menopause and stop having periods. Which means they can't have children after that. Since Men's bodies don't change in that sense a male vampire can produce viable sperm. Of course that doesn't make sense either because like you said they have no blood to get an erection in the first place. Even if they do have blood, there is no way for it to travel to the penis since the heart is responsible for pumping blood throughout the body and therefore to the penis to produce an erection and their hearts don't beat.