What Serris said. And I would add that producing the H2 is the easy part. The truly difficult part is extracting the CO2 from the atmosphere, removing the oxygen atoms and building hydrocarbon chains. Even plants, who have had billions of years of time to bring photosynthesis to perfection, achieve a maximum efficiency of about 12% of transforming the Sun's energy in the energy stored in glucose, and effectively the efficiency is about 3%. Artificial photosynthetic systems employ expensive catalysts, and still achieve lower efficiencies than plants at atmospheric concentrations of CO2.
It's certainly possible to build hydrocarbons at greater efficiency than living beings, but scuh a process requires high concentrations of CO2, like in the exhaust from a coal plant for example, and either catalysts who use expensive metals such as ruthenium, platinum (artificial photosynthesis) etc. or high temperature and high pressure (the Fischer-Tropsch process).
Concentrating atmospheric CO2 requires further expenditure of energy, so the total efficiency goes below that of plants again. The only way to make this remotely economical is not to use atmospheric CO2, but CO2 from power plants instead. This way you recycle the carbon once, but after that it still ends up in the atmosphere, where you can kiss it goodbye and have to wait for the self-replicating organic machinery we call plants to remove it from the atmosphere eventually.
A superior approach would be to enforce efficiency. For example, with new materials cars and airplanes can be made 4 times lighter, but equally strong, and modern insulation makes it possible to heat a house only by cooking and body heat (of course, this level of insulation is still very expensive, but even with much less insulation you can save 50% of heat and more).
Then produce electricity by any combination of alternative energy sources. I reckon that solar cells will eventually be more economical and politicaly viable than any other source, unless a deus ex machina occurs in the form of cheap nuclear fusion.
Then, convert as many industrial processes to electricity as possible. This is already going on, but it could be accelerated. For example, if the metal industry could be completely converted to electrolysis for metal extraction (e.g. iron or silicon), it would eliminate a lot of pollution from buring coal and make a key component of the global system independent of fossil fuels. Fertiliser production can also be completely electrified. And phosphorus extraction from waste as well.
Some liquid fuels will still be required for transportation for a long time, but the need for them can be drastically reduced, and in the future, eliminated.