Viagra could slightly increase the risk of developing skin cancer.

Researchers at New York University found that despite raising the risk of melanoma by 21 percent, erectile dysfunction drugs are unlikely to cause the deadly skin cancer. However, they found that following a "lifestyle that involves ingesting medications to prevent erectile dysfunction can be blamed," The Business Standard reported.

"What our study results show is that groups of men who are more likely to get malignant melanoma include those with higher disposable incomes and education -- men who likely can also afford more vacations in the sun -- and who also have the means to buy erectile dysfunction medications, which are very expensive," Stacy Loeb, lead author of the study and NYU Langone urologist, said in a statement.

For the study, researchers collected and analyzed the medical records on more than 20,000 men. Four-thousand and sixty-five men were found to have malignant melanoma between 2006 and 2012. Among these men were 2,148 who had used any of the three main drugs for erectile dysfunction -- Viagra (also known as sildenafil), Levitra (vardenafil), and Cialis (tadalafil) -- and among them, some 435 had the skin cancer.

Based on their findings, researchers concluded that the risk of melanoma found among erectile dysfunction drug users was modest, weakening the idea that the drugs were behind the overall observed increase in risk, Yahoo News reported.

"When used appropriately, erectile dysfunction medications are very effective and improve the quality of life for many men, so men should know it is doubtful that taking these medications puts them at greater risk of getting skin cancer," Loeb said.

The findings are detailed in the Journal of the American Medical Association.