There are several interesting things going on when a car turns.
First - let's take the simple diagram of two front wheels turned by 45°:
As you can see, the top tire would like the car to turn around the point $C_1$, but the bottom tire (at the same angle) wants to turn around $C_2$. This means that in reality both tires will experience some lateral slip. In ordinary cars, this problem is normally solved with something called the Ackermann steering geometry which makes the wheels turn by a slightly different amount so they both "want" the same center of rotation; this means that in reality the inner wheel is turned a bit more sharply than the outer wheel:
This is a bit of a simplification, but I hope you appreciate that wheels should not, in general, point in the same direction when you turn (in fact, for reasons of stability they don't point the same way when you drive straight, either - this is something called the toe and it needs adjusting from time to time when you get a wheel alignment done on your car).
Now let's look at the forces acting on the wheels.
To simplify things, I am going to draw just two wheels like you did in your simulation. We see that the inner wheel is making a tighter turn than the outer wheel; the net force on the car must be such that the center of mass $C$ makes a circle of radius $R$ about point $P$:
Now let us assume initially that the wheels only have lateral friction: that is, they roll perfectly and the force on them is perpendicular to the direction they are pointing. The resulting force must be centered on the center of mass, and point to the center of rotation. In other words - can we solve for $F_1$ and $F_2$? Extending the forces $F_1$ and $F_2$ along their direction, we get the following diagram and see there is a relationship between $F_1$ and $F_2$:
Now if the front wheel were to change the direction in which it is pointing, the amount and direction of force that it provides will change. But until the car changes its path, the force on the rear ($F_1$) does not change.
What you need to do is this.
By changing the angle of the front wheels and solving for the rotation in the steady state (basically, solving the parallelogram of forces I drew above) you will get a relationship between the forces $F_1$ and $F_2$ and the angle between the wheel and the velocity vector (in fact this is the same in magnitude as the angles $\theta_1$ and $\theta_2$ in my diagram).
When the front wheel changes direction, you are changing the angle between it and the velocity vector; but if you suddenly change the front wheel to pointing "straight", the rear wheel (still) finds itself at an angle to the velocity vector. This means that there will be a lateral force (which you can calculate from the relationship above), and a torque that will straighten out the car.
UPDATE a better way to look at the equation of motion is to work backwards: you know that the motion of the font of the car must follow the direction in which the wheel is (instantaneously) pointing; similarly, the back must follow the direction the rear wheel is pointing. This tells you what the position of the car will be after $\Delta t$, and from this you can compute the instantaneous acceleration and thus force / torque of the wheels. Such a model will give you the right motion as well as the correct forces.
I wrote a simple implementation of the motion (not the force calculation) in Python:
# simple car simulation
# one front wheel, one back wheel
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
length = 2 # axis to axis
# time when wheel is turned, and by how much:
timePoints = [0, 1, 5, 9, 12, 15]
thetaPoints = [0, 0, 15, 15, 0, 0]
theta = interpolate.interp1d(timePoints, thetaPoints)
# time step for simulation:
dt = 0.05
# show that it worked:
t = np.arange(0, 15, dt)
plt.title('steering angle vs time')
# position of rear wheel of car at time t:
x = 0
y = 0
# velocity of rear wheel
v = 5
# angle of car body
alpha = 0
for T, th in enumerate(theta(t)):
dx = v * dt * cosd(alpha)
dy = v * dt * sind(alpha)
vf = v / cosd(th)
dxf = vf * dt * cosd(th+alpha)
dyf = vf * dt * sind(th+alpha)
yl = dyf - dy + length * sind(alpha)
xl = dxf - dx + length * cosd(alpha)
alpha = atan2d(yl, xl)
plt.plot([x, x+xl], [y,y+yl], 'r', linewidth=5)
x = x + dx
y = y + dy
In this case the wheel is turned slowly - according to the following plot:
and the trajectory is given by this plot (the red line corresponds to the direction that the car is pointing every 2.5 seconds - you can see that when the wheel is straight, the car follows the direction of the wheels):