Chain conformations and phase separation in polymer solutions with varying solvent quality