If a person is unsure whether or not he counted a day of the Omer, and cannot determine conclusively if he had counted or if he had missed that day, he continues counting the Omer each night with a Beracha. This is the explicit ruling of the Shulhan Aruch.
However, this Halacha applies only in cases of general uncertainty whether or not a day of counting was missed. But if a person knows for certain that he did not count one night, and is unsure whether or not he counted during the next day, then he continues counting without a Beracha. This is the ruling of the Erech Ha’shulhan (Rabbi Yishak Taib, Tunisia, 1786-1828). Since he knows with certainty that he had not counted at night, he may not count with a Beracha unless he knows for certain that he counted during the next day.
If a person knows for certain that he counted, but is unsure whether he counted the correct number, as he suspects that he might have counted incorrectly, he may continue counting with a Beracha. This is the ruling of Hacham Ovadia Yosef in Hazon Ovadia – Hilchot Yom Tob (p. 238).
If one did not count the Omer until the end of the night, and he is unsure whether he counted while it was still nighttime or whether it was already the beginning of the next day, he continues counting with a Beracha. This is the ruling of the Maharash Engel (5:48).