EU agrees 'flexible' renewable energy targets for 2030