Optimal proportional reinsurance and investment for stochastic factor models