Process for carrying out a chemical reaction with ionic liquid and carbon dioxide under pressure