Everybody is suggesting you drop the LED current. If it is a normal LED, it will drop about 2V at 20 mA. Worst case, if your power supply delivers 12V, you need to drop 10V across the resistor. If you really want the entire 20 mA (and there is no reason you should), you want a 500 Ohm resistor. If you consider this to be your worst case voltage, fine. I would probably calculate for 10 mA at 12V and use a 1k resistor. At 9V I would still have 7 mA through the LED and this may still be bright enough. Experiment with different resistors and see how it works out. Higher resistance results in less current.
Try some other values. Any way you do it, you dissipate heat equal to the voltage drop times the current. The LED dissipates heat related to its voltage drop and the current.
P = I^2 * R
P = E^2 / R
P = I * E
Values in amps, volts and ohms... It might be fun to look at options in a spreadsheet!