what is the use of carbon dioxide in photosynthesis