You would have to do it in a script.
A simple way is to have a line on the top of each page that says includes another file and in the other file have it so it says if the ip address is equal to one in your ban list then either echo Error or something then break; which should stop the page from loading.
What you would want to do is get a list of IPs from the countries you want to ban and ban the whole subnet or the whole class C or B range. Like if your IP was 10.20.30.40 and the 10.20 is Ireland and you want to ban everyone from Ireland then you would take and grab the first 2 sets of numbers from the visitors IP and if they equal the numbers you have in your ban list then do the break thing and that is like a ban from your site.
I wouldn't really recommend banning people unless you have a good reason to. For us it is to prevent abuse from known countries that most hosts have problems with. You don't have to worry about server security or bandwidth really (with the huge amount you get) so there shouldn't be much of a reason for you to ban a country. (just my 2 cents)
Hope that makes sense and helps a little bit. To find out the exact functions php.net has a function search or Google it, I don't want to give you a wrong function and confuse you