The photochemistry of hydrocarbons in Titan's atmosphere