The analogWrite() function needs a timer. The IR library needs a timer. It is possible that they are trying to use the same timer, and the IR library is winning. Try using pin 3 or 5 for the LED pin.
If you consistently used the NAME you assigned to the pin, you'd only need to change one line of code. As it is, you have to change more than one.