Interpreting the observed UV continuum slopes of high-redshift galaxies