Aligning biological sequences by exploiting residue conservation and coevolution