First-principles study of electronic structure and magnetic properties of SrTi1−xMxO3 (M= Cr, Mn, Fe, Co, or Ni)