Betti numbers of Koszul algebras and codimension two matrix factorizations