Germany's leaders have taken a crucial step towards breaking a deadlock that has prevented the formation of a new government since elections four months ago.