A Democratic representative running for California governor has dropped out of the race following sexual assault allegations he denies.