Rod-to-coil transition of a conjugated polymer in solution