We present a spatiotemporally integrated formulation of the optimal fractionation problem using the standard log-linear-quadratic survival model. Our objective is to choose a fluencemap and a number of fractions so as to maximize the biological effect of tumor dose averaged over its voxels subject to maximum dose, mean dose, and dose-volume constraints for various normal tissues. Constrains are expressed in biologically effective dose equivalents. We propose an efficient convex programming method to approximately solve the resulting computationally difficult model. Through extensive computer simulations on ten head-and-neck and prostate cancer test cases with a broad range of radiobiological parameters, we compare the biological effect on tumor obtained by our integrated approach relative to that from two other models. The first is a traditional IMRT fluence-map optimization model that does not optimize the number of fractions. The second assumes that a fluence-map is available a priori from a traditional IMRT optimization model and then optimizes the number of fractions, thus separating the spatial and temporal components. The improvements in tumor biological effect over IMRT were 9%-52% with average 22%, and 53%-108% with average 69%, for head-and-neck and prostate, respectively. The improvements in tumor biological effect over the spatiotemporally separated model were 15%-45% with average 27%, and 17%-23% with average 21%, for head-and-neck and prostate, respectively. This suggests that integrated optimization of the fluence-map and the number of fractions could improve treatment efficacy as measured within the linear-quadratic framework.