It is associated with increased risk of melanoma, but not known to cause it. The third variable is expected to be lifestyle / socioeconomic. https://jamanetwork.com/journals/jama/fullarticle/2338254
> Men taking PDE5 inhibitors had a higher educational level and annual income, factors that were also significantly associated with melanoma risk.