Maintaining a List on Your Server
There are several sites with free lists of IPs for specific countries, ready to download.
Once you have a list, you can block the IPs in htaccess or httpd.conf. In my view, this is a cumbersome way of blocking visitors from certain countries, because IPs change all the time. Do you want to update your IP country table all the time?
If you did want to use this method, you might add lines like these to your .htaccess:
Allow from all
Deny from 126.96.36.199/15
Deny from 188.8.131.52/16
… etc. (huge list of IP addresses or ranges