There is no risk for gonorrhea, chlamydia, syphilis, HPV, mycoplasma, molluscum, herpes - these are not spread by blood.
There is no risk for HIV - HIV dies very quickly once outside the body. It would have died by the time you touched the blood and then touched yourself.
For the rest - tell me about this blood. How did you accidentally touch it? Where did you come across it? How long after touching it did you masturbate?