An ab initio study of the cis-trans photoisomerization of stilbene