Yes, you can use a credit card for pretty much everything in Iceland. On all our recent trips we never had any cash and we didn't miss it at all. Even the smallest purchases can be paid by credit card. However, make sure that you have a credit card with a 4-digit pin.