Earth is gone. The Moon is gone. Mars gets nuked. The entire Solar System becomes hotter than Mercury for a couple days. The Sun will appear to glow up to 12,000 times brighter. The Solar System will be forever scarred.
As jdunlop's answer says very succinctly, 'everything dies'. But let me tell you precisely how dead everything is.
The asteroid delivers energy equal to half a solar mass of TNT to the Earth. One-20,000'th of this energy is used to reduce Earth to dust and hurl it to the far corners of the Universe. About one-100'th of this energy is used to push the Earth's remains in the direction of the asteroid's motion. The rest of this energy is used to blast out an omnidirectional spray of debris travelling at around 0.004 times the speed of light and to heat the Earth's remains to about a billion degrees. In other words, 99% of the asteroid's energy makes a plain and simple explosion.
This explosion is powerful enough to destroy the Moon a hundred times over. This explosion will do the equivalent of nuking every square metre of the near side of Mars (and every other inner planet). With only 4 months to evacuate, you need to put a planet or the Sun between yourself and the Earth if you wish to survive, and to do that you'll need to fly really fast.
If we assume that the ball of plasma which used to be the Earth radiates away energy following an exponential decay with a lifetime of about one day, similar to some novae, then the entire Solar System will receive many times more power per square metre than Mercury receives from the Sun for many days. The damage this could cause to icy asteroids and the surfaces of the outer planets is enormous.
Even after the ball of plasma cools below ludicrous levels, the blast wave of debris would take a couple of months to sweep its way through the Solar System. This would present a second wave of destruction after the initial furnace-blast.
To a distant observer, it will appear that the Sun suddenly grew up to 12,000 times brighter (a difference of 10.2 apparent magnitudes). The Sun would appear to return to normal after about 10 days under my very crude estimates.
The Solar System will never be the same again. Any humans who managed to survive would find that the planets of the Solar System look very different to how they used to be.
If you would like to see how I arrived at these conclusions, read on...
The mass of the asteroid is about $3.7\times 10^{22}$ kg. Its velocity is about $1.5\times 10^7$ m/s. With a Lorentz factor of only 1.001, we can use the Newtonian formulae for kinetic energy $E=\frac{1}{2} m v^2$ and momentum $p=m v$ with reasonable accuracy. The asteroid has kinetic energy of $4.2\times 10^{36}$ J and momentum of $5.5\times 10^{29}$ kg m/s.
For something interacting with the Earth, this energy is ludicrously large. Based on Wikipedia's Orders of magnitude (energy) table (which is one of my favourite tables ever), the gravitational binding energy of the Earth is a mere $2\times 10^{32}$ J. Exceeding this energy by a factor of 21,000, this asteroid easily turns the Earth into a rapidly expanding ball of plasma and super-heated dust being flung to the farthest reaches of the universe.
But destroying just the Earth and removing it to the farthest corners of the universe takes only a tiny fraction of the asteroid's energy. What happens to the rest of the energy?
Momentum
Perhaps it goes into conservation of momentum (although I shall show that this is also only a tiny fraction). Earth has a mass of $6.0\times 10^{24}$ kg and orbital speed of $3.0\times 10^4$ m/s, so its momentum has magnitude $1.8\times 10^{29}$ kg m/s, which is of comparable order of magnitude to the asteroid's momentum, although the Earth's momentum could be pointing in any direction relative to the asteroid.
Suppose for a moment that all the bits of the Earth were blasted away in the same direction as the asteroid's motion, and that the asteroid and the Earth were travelling in the same direction so that their momenta added together ($7.3\times 10^{29}$ kg m/s). The final velocity of the Earth in this scenario is $1.2\times 10^5$ m/s, with a kinetic energy of $4.3\times 10^{34}$ J (for reference, the kinetic energy of the Earth pre-impact is $2.7\times 10^{33}$ J). This is a mere 1% of the energy delivered by the asteroid. This means that the Earth can't explode in just a straight line, but instead must explode in all directions in order to get rid of more energy.
As a crude estimate, if we assume that the energy of the asteroid all goes into the kinetic energy of this omnidirectional spray, then we would get the rubble going at a speed of $1.2\times 10^6$ m/s, or 0.004 c. However, as I discuss below, some of this energy will also go into super-heating the rubble.
Heating
Such an impact would almost definitely involve substantial heating of the Earth. Most of the Earth is magma (and iron, but iron has a lower heat capacity and similar boiling point). Your typical magma under atmospheric pressure has a specific heat capacity of about 1500 J/kg/K (source: 'Thermodynamic and Transport Properties of Silicate Melts and Magma', Lesher and Spera) and while I do not expect this to be very accurate at mantle pressures it's probably the right order of magnitude. And we've already blown up the Earth into little bits, so it isn't under pressure any more.
To heat up the entire planet by one degree assuming a specific heat capacity of 1500 J/kg/K would take $9\times 10^{27}$ J/K. The boiling point of silicon dioxide is 2950 degrees Celsius. Heating the Earth by 3000 degrees would take about $2.7\times 10^{31}$ J, which is a tiny fraction of the asteroid's energy.
Having turned the Earth into a gas, we can approximate its heat capacity as being that of an ideal monoatomic gas, which is 12.5 J/K/mol (this is not necessarily an accurate approximation, but it's probably good enough for our purposes). Now we need the molar mass of the Earth. Based on the composition of the Earth, the average molar mass of the Earth is approximately $56\times 0.32 + 16 \times 0.30 + 28 \times 0.15 + 24 \times 0.14 = 30.3$ g/mol, or 0.030 kg/mol. This gives a specific heat capacity of 417 J/K/kg. An Earth-mass of this gas would have a heat capacity of $2.5\times 10^{27}$ J/K.
If we were to assume that almost all our asteroid's kinetic energy went into heating the Earth, it would reach a temperature of $1.7\times 10^9$ K. Over one billion degrees. Based on another excellent table, this is over a hundred times hotter than the core of the Sun and is the temperature range in which nuclear fusion reactions are measured. This temperature is ludicrously hot.
At this point I have done maths which assumes all the energy goes into either heating or kinetic energy. Clearly this is a contradiction. The real answer would be somewhere between these two extremes. Precisely where I cannot say, although it's probably half-half to within an order of magnitude.
Kaboom! Everyone dies
The energies we are dealing with are ludicrous. Some of the energy will go into an omnidirectional spray of hyper-velocity rubble. Some of the energy will go into heating the remains into a ball of plasma which outshines the Sun. Regardless of the form of this energy, the result is quite clearly an explosion. A very big explosion.
As I have calculated above, only about 1% of the energy of the asteroid goes into pushing the Earth. The remaining 99% of those $4.2\times 10^{36}$ Joules goes into making an explosion with the same energy as half a solar mass of TNT.
Let us assume we have a spherically expanding blast wave. The energy per square metre (or fluence) is given by $E/(4\pi r^2)$, where $r$ is distance in metres from the epicenter (that is, energy divided by surface area of the blast wave, giving us the inverse square law).
The surface of the Moon, which is $3.8\times 10^8$ m from the Earth, will receive a fluence from this explosion of $2.3\times 10^{18}$ J/m$^2$. That's the energy of eleven Tsar Bombas every square metre. The Moon has a radius of $1.7\times 10^6$ m, a circular cross-section of $9.1\times 10^{12}$ m$^2$, so will receive $2.1\times 10^{31}$ J from the explosion. The gravitational binding energy of the Moon is only $1.3\times 10^{29}$ J (approximately).
The explosion is big enough to destroy the Moon a hundred times over.
Clearly, anywhere in Earth orbit is not safe. Not even the Moon would shield you from the explosion. How far away does humanity need to be to be safe, then?
Let's look at a Mars colony, which is the third most likely celestial body for humans to be on (after Earth and the Moon). Mars is between $5.46\times 10^{10}$ m and $4.01\times 10^{11}$ m from the Earth, with an average of $2.25\times 10^{11}$ m (source). Mars will receive a fluence between $2.1\times 10^{12}$ and $1.1\times 10^{14}$ J/m$^2$ (unless it is hiding behind the Sun), depending where it is in its orbit. At the low end, this is equivalent to a layer of TNT 300 metres thick (based on a density of 1650 kg/m$^3$). At the high end, this is equivalent to three layers of Fat Man nuclear bombs (closely packed, standing on their tails). (The polar regions would be better off than the equator, due to the oblique angle, but only slightly.) This won't destroy Mars, but it would definitely do nasty things to the surface of the planet and would probably destroy all but the most robust of Martian colonies.
This is a problem for humanity. It takes around 7 months to get to Mars with current technology, and in your scenario humanity only has 4 months. Since humanity has no hope of escaping the blast radius, their only hope in this scenario is to sit in space stations and space ships which are sheltering behind planets or the Sun at the time of the explosion. I hope you have some really fast ships.
How long will it last?
While total energy is one metric, another metric is power, or energy per unit time. Knowing the power will tell us how bright the explosion will appear. To know the power, we need to know how long the explosion lasts.
However, calculating this directly would be beyond the scope of this site. So I will assume (as an extremely crude estimate) that our explosion will follow a similar initial energy decay profile as the nova V1500 Cygni, since its light-curve has the data I need and it is also a cosmic explosion. The choice of this nova was very arbitrary and done by inexpert and brief searching, so I cannot guarantee that it is truly representative, but it's probably good for a rough guess.
Over three days the brightness of V1500 Cygni decayed by 3 apparent magnitudes, or a factor of 15.85. If we assume exponential decay $e^{-t/\tau}$, the lifetime $\tau$ of V1500 Cygni would be $9.4\times 10^4$ s, or 26 hours.
From $\int_0^\infty e^{-t/\tau} dt = \tau$, we can say that the peak power output of our explosion is $E/\tau = 4.5\times 10^{31}$ W. From my second favourite table, this is 12,000 times more luminous than the Sun. It has a similar luminosity to Beta Centuri, one of the brightest 'stars' in the sky at a distance of 390 light-years away.
Based on this very crude estimate, the explosion will deliver half of its total energy within the first $6.5\times 10^4$ s, or 18 hours. This first 1% of the explosion's power, the amount required to destroy the Moon, comes in the first 945 seconds, or 16 minutes.
Of course, this model is fairly crude, as nova light-curves only capture the energy delivered by radiated light. In reality this explosion will have two components - the thermal radiation from the billion degree plasma, and the hyper-velocity wave of matter. The shock wave from the debris cloud would probably deliver the energy more abruptly, but long after the initial thermal shock. At 0.004 c, the blast wave would take 96 days to travel $10^{13}$ m to the edge of the Solar System, so even after the initial thermal blast has cooled off the material blast wave will still be a threat for a couple of months.
It is beyond my capabilities to calculate what fraction of the energy goes into heating and what fraction goes into kinetic energy, but I would guess that they would be within an order of magnitude of 50%. In the following, for simplicity, I assume the energy is all thermal, giving an upper bound. You can scale down the brightness figures proportionally.
Note also that the Earth's center of mass will only be moving a few times faster than its normal orbital velocity, so the Earth will mostly remain inside the Solar System for the duration of this explosion.
But what if we go further away?
Checking this table, the Solar System is only about $10^{13}$ m in radius. If you stood at the edge of the Solar System, you would receive a fluence of $3.3\times 10^9$ J/m$^2$, or about 786 kg TNT per square metre, or a layer of TNT half a metre thick. At a peak power of $4.5\times 10^{31}$ W, we get a peak flux at the edge of the Solar System of $3.5\times 10^4$ W/m$^2$, which is about 26 times brighter than the Sun at Earth's orbit. For reference, the solar flux at Mercury's closest approach of 0.3 AU is only 11 times brighter than the Sun at Earth's orbit.
The entire Solar System will roast at temperatures hotter than Mercury for several days until the ball of plasma which used to be the Earth cools down. I hope you have a nice planet for shade.
It is possible that these temperatures might destroy many comets and icy asteroids, wreak havoc on the icy moons, and possibly ablate away some of the atmospheres of the outer planets. And, of course, the inner planets receive a scouring similar to a rain of nuclear warheads.
But what will this look like to an observer in another star system?
The power output (luminosity) of the Sun is $3.846\times 10^{26}$ W. Our explosion peaks at $4.5\times 10^{31}$ W. This means an observer will see the Sun flare to be about 12,000 times brighter than normal, or 10.2 apparent magnitudes. At a decay of 1 apparent magnitude per day, the brightness would mostly return to normal after about 10 days, assuming my crude model for the energy radiation holds for that long.
But don't let that fool you. The Solar System might appear to be back to normal from far away, but this explosion has scoured the face of the Solar System and left nothing unscathed. The planets will continue to orbit (besides Earth, of course), but the whole Solar System will bear the scars of this cataclysmic event for the rest of its life.