Who is to blame when driverless cars have an accident?

The news that an Uber self-driving vehicle has killed a pedestrian in the US has made headlines around the world.