Ab initio calculation of the intercalation voltage of lithium-transition-metal oxide electrodes for rechargeable batteries