Counting is under way in the Afghan presidential election after voting went ahead in most areas despite sporadic Taliban attacks.