Surface defects and chiral algebras