Boris Johnson has warned the Conservatives will not win the next election by "bashing the green agenda".