Based on density-functional perturbation theory we have computed the photoelastic tensor of a model of sodium silicate glass of composition (Na$_2$O)$_{0.25}$(SiO$_2$)$_{0.75}$ (NS3). The model (containig 84 atoms) is obtained by quenching from the melt in combined classical and Car-Parrinello molecular dynamics simulations. The calculated photoelastic coefficients are in good agreement with experimental data. In particular, the calculation reproduces quantitatively the decrease of the photoelastic response induced by the insertion of Na, as measured experimentally. The extension to NS3 of a phenomenological model developed in a previous work for pure a-SiO$_2$ indicates that the modulation upon strain of other structural parameters besides the SiOSi angles must be invoked to explain the change in the photoelstic response induced by Na.