A Variational Principle for Computing Nonequilibrium Fluxes and Potentials in Genome-scale Biochemical Networks