How long is syphilis contagious?

How long is syphilis contagious?