Answer
5800 K
Work Step by Step
For a perfect blackbody, radiant power $P=\sigma AT^{4}$
where $\sigma=5.67\times10^{-8}\,\frac{J}{s\cdot m^{2}\cdot K^{4}}$ is the Stefan-Boltzmann constant, $A$ is the surface area and $T$ is the surface temperature in Kelvins.
$A=4\pi R^{2}$ where $R$ is the radius of the sun.
That is, $A=4\pi(6.96\times10^{8}\,m)^{2}=6.09\times10^{18}\,m^{2}$
$T=(\frac{P}{\sigma A})^{\frac{1}{4}}=(\frac{3.9\times10^{26}\,W}{(5.67\times10^{-8}\,\frac{J}{s\cdot m^{2}\cdot K^{4}})(6.09\times10^{18}\,m^{2})})^{\frac{1}{4}}=5800\,K$